Skip to content

Conversation

@VrianCao
Copy link
Owner

问题描述

本仓库年久失修,存在以下问题:

  1. 自定义API兼容性差,无法正确处理不同格式的响应
  2. 流式输出功能存在问题
  3. OpenAI作为默认翻译渠道,没有地方可以填写模型和API Key

修复内容

  1. 增强了自定义API兼容性,支持更多响应格式

    • 添加了对多种API响应格式的处理
    • 改进了错误处理和提示信息
  2. 修复并改进了流式输出功能

    • 添加了流式输出开关
    • 优化了流式输出的处理逻辑
  3. 添加了OpenAI设置组件

    • 可配置API密钥、模型和端点
    • 设置保存在本地存储中
  4. 其他改进

    • 更新了next.config.mjs,添加了跨域支持
    • 增加了API请求超时时间,避免大文本翻译超时
    • 优化了翻译提示词,提高翻译质量

测试方法

  1. 启动应用:npm run dev
  2. 测试流式输出功能:开启/关闭流式输出开关,观察翻译效果
  3. 测试OpenAI设置:点击OpenAI服务旁的设置图标,配置API密钥等
  4. 测试自定义API:添加自定义API并测试翻译功能

1. Improved custom API compatibility with better response format handling
2. Enhanced OpenAI translation with configurable model and API endpoint
3. Fixed streaming output functionality
4. Updated next.config.mjs with proper API routing and security headers
5. Added timeout configuration for large text translations
@vercel
Copy link

vercel bot commented May 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
simplelmt ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2025 4:35pm

@netlify
Copy link

netlify bot commented May 21, 2025

Deploy Preview for simplelmt ready!

Name Link
🔨 Latest commit f424704
🔍 Latest deploy log https://app.netlify.com/projects/simplelmt/deploys/682e00aff41c95000803b181
😎 Deploy Preview https://deploy-preview-3--simplelmt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@deno-deploy deno-deploy bot had a problem deploying to Preview May 21, 2025 16:36 Failure
@VrianCao
Copy link
Owner Author

Waiting to fix:
你只修复了预设渠道中OpenAI渠道的设置,没有修复其他的(谷歌翻译、DeepL、通义千问、硅基流动)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants